<?php
class FileUtils{
	
	private static $mimeTypeToFileExtensionMap = array("jpeg" => "jpg",
													   "png" => "png",
													   "gif" => "gif");
	
	/*
	 * returns the file extension for mime type given
	 * 
	 * @param mimeType
	 * @return extension
	 */
	public static function mimeTypeToFileExtension($mimeType){
		
		return self::$mimeTypeToFileExtensionMap[$mimeType];
	}

	public static function getImageFileNameFromImageLocation($location, $galleryName){
		
		$fileName = str_replace(GALLERY_IMAGE_URL . "/", "", $location);
		$fileName = str_replace(str_replace(" ", "", $galleryName) . "/", "", $fileName);
		return $fileName;		
	}
}

?>